package com.bee.beeLove.controller;

import com.bee.beeModel.Love.People;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试的controller
 * @description:
 * @author: chenguosong
 * @date: 2022-11-22 17:23
 */
@RestController
@RefreshScope
public class TestController {

    @Value("${test.name}")
    private String test;

    @GetMapping("/test")
    @PreAuthorize("hasAnyAuthority('sys:user:test1')")
    public People test(){
        People people = new People();
        people.setAge("18");
        people.setName(test);
        return people;
    }
}
